using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FitnessClub.Bll.StaffManager;

public partial class EmployeesAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnDodaj_Click(object sender, EventArgs e)
    {
        ReqHEmp req = new ReqHEmp();
        req.City = tbxCity.Text;
        req.Name = tbxName.Text;
        req.Surname = tbxSurname.Text;
        req.Pesel = tbxPesel.Text;
        req.Flat_nr = tbxFlat_nr.Text;
        req.House_nr = tbxHouse_nr.Text;
        req.Street = tbxStreet.Text;
        req.Postal_code = tbxPostal_code.Text;
        req.Phone = tbxPhone.Text;
        req.Salary = tbxSalary.Text;
        ResHEmp result = Delegate.hireEmployee(req);
        if (!result.IsOK)
            lblErrors.Visible = true;
        else
        {
            lblErrors.Visible = false;
            Response.Redirect("Employees.aspx");
        }
    }
    protected void btnPowrot_Click(object sender, EventArgs e)
    {
        Response.Redirect("Employees.aspx");
    }
}
